package c1705;

import java.util.Scanner;

public class A {
    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        long a = cin.nextLong();
        long b = cin.nextLong();
        long c = gcd(a, b);
        System.out.println(c * c);
        cin.close();
    }
}